#include <stdio.h>
int main ()
{
	int i,n,t,p,m;
	scanf("%d",&n);
	int group[n];
	for(i=0;i<n;i++)
	    scanf("%d",&group[i]);	
	for(i=0;i<n;i++)
	{   
		m=group[i];
		p=2;
		for(t=4;t<=m;t++)
		{
			if(p+3<=t)
			   p=p+3;
			else
			   p=p+3-t;
		}
		printf("%d\n",p);
	}
 } 
